package com.share.api;

import com.share.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * author:caifan
 * date:2019/7/18
 */
@FeignClient(value = "user-service")
@RequestMapping("/rest/user")
public interface UserApi {
    @GetMapping(value = "/{id}")
    ResponseEntity getUserById(@PathVariable("id") Long id);

    @PostMapping(value = "/save")
    ResponseEntity saveUser(User user);

    @GetMapping(value = "/getIPAndPort")
    String getIPAndPort();

}
